package com.microinvest.dao;

import com.microinvest.entity.BuyStock;
import com.microinvest.entity.SellStock;
import com.microinvest.entity.UserStockSummary;
import com.microinvest.util.BigDecimalUtil;
import org.apache.ibatis.annotations.Mapper;

import java.math.BigDecimal;

@Mapper
public interface TransactMapper {

//    //提取用户交易的总信息
//    UserStockSummary getUserStockSummary(Integer userId);

    //提交用户的购买表单
    void addUserBuyStock(BuyStock buyStock);

    //提交用户卖出的表单
    void addUserSellStock(SellStock sellStock);

    //返回用户某一stock的数量
    int returnOneStockTotalQuantity(int userId,String stockSymbol);

    //增加用户的股票持有数量
    void addStockQuantity(int userId,String stockSymbol,int quantity);

    //减少用户的股票持有数量
    void reduceStockQuantity(int userId,String stockSymbol,int quantity);

    //添加用户购买的总amount
    void addUserTotalAmount(String stockSymbol, BigDecimal totalAmount);

    //减少用户购买的总amount
    void reduceUserTotalAmount(String stockSymbol, BigDecimal totalAmount);

}
